In-lane vector shuffle instructions

ABSTRACT

In-lane vector shuffle operations are described. In one embodiment a shuffle instruction specifies a field of per-lane control bits, a source operand and a destination operand, these operands having corresponding lanes, each lane divided into corresponding portions of multiple data elements. Sets of data elements are selected from corresponding portions of every lane of the source operand according to per-lane control bits. Elements of these sets are copied to specified fields in corresponding portions of every lane of the destination operand. Another embodiment of the shuffle instruction also specifies a second source operand, all operands having corresponding lanes divided into multiple data elements. A set selected according to per-lane control bits contains data elements from every lane portion of a first source operand and data elements from every corresponding lane portion of the second source operand. Set elements are copied to specified fields in every lane of the destination operand.

CROSS REFERENCE TO RELATED APPLICATIONS

The present application is a continuation of U.S. patent applicationSer. No. 15/613,809, filed on Jun. 5, 2017, titled “IN-LANE VECTORSHUFFLE INSTRUCTIONS”, which is a continuation of U.S. patentapplication Ser. No. 13/838,048, filed on Mar. 15, 2013, now U.S. Pat.No. 9,672,034, issued on Jun. 6, 2017, which is a continuation of U.S.patent application Ser. No. 13/219,418, filed on Aug. 26, 2011, now U.S.Pat. No. 8,914,613, issued on Dec. 16, 2014, which is a continuation ofU.S. patent application Ser. No. 11/967,211, filed on Dec. 30, 2007, nowU.S. Pat. No. 8,078,836, issued on Dec. 13, 2011. U.S. patentapplication Ser. No. 11/967,211 is hereby incorporated herein by thisreference in its entirety and for all purposes.

FIELD OF THE INVENTION

The invention relates to computer systems, and in particular, to anapparatus and method for performing multi-dimensional computations usingan in-lane shuffle operation.

BACKGROUND

A Single Instruction, Multiple Data (SIMD) architecture improvesefficiency of multi-dimensional computations. Implemented in computersystems, the SIMD architecture enables one instruction to operate ondata simultaneously, rather than on a single data. In particular, SIMDarchitectures take advantage of packing many data elements within oneregister or memory location. With parallel hardware execution, multipleoperations can be performed with one instruction, resulting insignificant performance improvement.

Although many applications currently in use can take advantage of suchoperations, known as vertical operations, there are a number ofimportant applications which require the rearrangement of the dataelements before vertical operations can be implemented so as to providerealization of the application. Examples of some important applicationsinclude the dot product and matrix multiplication operations, which arecommonly used in 3-D graphics and signal processing applications.

One problem with rearranging the order of data elements within aregister or memory word is the mechanism used to indicate how the datashould be rearranged. Typically, a mask or control word is used. Thecontrol word must include enough bits to indicate which of the sourcedata fields must be moved into each destination data field. For example,if a source operand has eight data fields, requiring three bits todesignate any given data field, and the destination register has fourdata fields, (3×4) or 12 bits are required for the control word.However, on a processor implementation where there are less than 12 bitsavailable for the control register, a full shuffle cannot be supported.Some approaches addressing such issues were presented, for example, inU.S. Pat. No. 6,041,404 and in U.S. Pat. No. 7,155,601.

The problem described above is made worse though, when even more datafields are permitted in the sources and destinations. Moreover thecomplexity of circuitry required to shuffle data and to control saidshuffling can increase proportional to the square of the number ofpermitted data fields causing undesirable delays, costing precious diearea, and consuming ever more power. Therefore, there is a need for away to reorganize the order of data elements where less than the fullnumber of bits is available for a control register in such a way as toscale to handle operands where even more data fields are permitted.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention will be described in detail with reference to thefollowing drawings in which like reference numerals refer to likeelements wherein:

FIG. 1 illustrates an exemplary computer system in accordance with oneembodiment of the invention;

FIGS. 2a to 2c illustrate flow diagrams for processes to perform shuffleinstructions according to a set of embodiments of the invention;

FIGS. 3a to 3b illustrate flow diagrams for processes to perform shuffleinstructions according to a set of alternative embodiments of theinvention;

FIG. 4 illustrates an example of a field of per-lane control bits;

FIGS. 5a to 5c illustrate the operation of the shuffle instructions inaccordance with embodiments of the invention.

FIGS. 6a to 6b illustrate the operation of the shuffle instructions inaccordance with alternative embodiments of the invention.

DETAILED DESCRIPTION

In-lane vector shuffle operations are described herein. In embodimentsof a shuffle operation, sets of data elements are selected fromcorresponding portions of each lane of a source operand according toper-lane control bits and copied to specified fields in correspondingportions of each lane of a destination operand. Other embodiments of theshuffle instruction specify two source operands, all operands havingcorresponding lanes divided into multiple data elements. Data elementsselected according to per-lane control bits include data elements fromeach lane portion of a first source operand and include data elementsfrom each corresponding lane portion of a second source operand, whichare copied to specified fields in corresponding lanes of the destinationoperand.

The shuffle instruction has useful applications in data reorganizationand in moving data into different locations of the register to allow,for example, extra storage for scalar operations, manipulation ofcomplex numbers that require transforms, or to facilitate conversionbetween data formats such as from packed integer to packed floatingpoint and vice versa. Such application in the technical arts include butare not limited to motion video compression/decompression, imagefiltering, audio signal compression, filtering or synthesis,modulation/demodulation, etc. Data formats of certain particular data orsignal types such as audio or motion video for example, which arerepresentative of or constitute communication, physical activity orobjects often have regular structures and component data elements whichcan be manipulated or transformed in substantially similar ways for eachlane of a source operand. Thus shuffling data elements according to afield of per-lane control bits is applicable to such data or signaltypes.

In the following description, numerous specific details are set forth toprovide a thorough understanding of the invention. However, it will beunderstood by one of ordinary skill in the art that the invention may bepracticed without these specific details. In other instances, well-knowncircuits, structures and techniques have not been shown in detail inorder not to obscure the invention.

FIG. 1 illustrates one of many embodiments of a computer system 101which implements the principles of the present invention. Computersystem 101 comprises a processor 105, a storage device 110, and a bus115. The processor 105 is coupled to the storage device 110 by the bus115. In addition, a number of user input/output devices 120, such as akeyboard, mouse and display, are also coupled to the bus 115.

The processor 105 represents a central processing unit of any type ofarchitecture, such as Complex Instruction Set Computer (CISC), ReducedInstruction Set Computer (RISC), very long instruction word (VLIW), or ahybrid architecture (e.g., a combination of hardware and softwaretranslation). Also, the processor 105 could be implemented on one ormore chips. The storage device 110 represents one or more mechanisms forstoring data. For example, the storage device 110 may include read onlymemory (ROM), random access memory (RAM), magnetic disk storage mediums,optical storage mediums, flash memory devices, and/or othermachine-readable mediums. The bus 115 represents one or more buses(e.g., Accelerated Graphics Port “AGP”, Peripheral ComponentInterconnect “PCI”, Industry Standard Architecture “ISA”, ExtendedIndustry Standard Architecture “EISA”, Video Electronics StandardArchitecture “VESA” and the like) and bridges (also termed as buscontrollers). While this embodiment is described in relation to a singleprocessor computer system, the invention could be implemented in amulti-processor computer system.

In addition, while embodiments of the invention are herein described inrelation to 256-bit operands having 128-bit lanes, the invention is notlimited to a computer system with 128-bit lanes or 256-bit operands. Forexample, lanes could be comprised of but not limited to having 64 bits,and operands could independently be comprised of but not limited tohaving 512 bits.

Furthermore, devices including but not limited to one or more of anetwork 130, a TV broadcast signal receiver 131, a fax/modem 132, adigitizing unit 133, a sound unit 134, and a graphics unit 135 mayoptionally be coupled to bus 115. The network 130 represents one or morenetwork connections (e.g., an Ethernet connection). The TV broadcastsignal receiver 131 represents a device for receiving TV broadcastsignals, the fax/modem 132 represents a fax and/or modem for receivingand/or transmitting analog signals. The digitizing unit 133 representsone or more devices for digitizing images (e.g., a scanner, camera,etc.). The sound unit 134 represents one or more devices for inputtingand/or outputting sound (e.g., sound card, microphones, speakers,magnetic storage devices, optical storage devices, etc.). The graphicsunit 135 represents one or more devices for generating images (e.g.,graphics card).

FIG. 1 also illustrates that the storage device 110 has stored thereindata 140 and software 145. Data 140 represents data stored in one ormore of the formats described herein. Software 145 represents thenecessary code for performing any and/or all of the techniques inaccordance with the present invention. It will be recognized by one ofordinary skill in the art that the storage device 110 may containadditional software (not shown), which is not necessary to understandingthe invention.

FIG. 1 additionally illustrates that the processor 105 includes decodeunit 150, a set of registers 151, execution unit 152, and an internalbus 153 for executing instructions. It will be recognized by one ofordinary skill in the art that the processor 105 contains additionalcircuitry, which is not necessary to understanding the invention. Thedecode unit 150, registers 151 and execution unit 152 are coupledtogether by internal bus 153. The decode unit 150 is used for decodinginstructions received by processor 105 into control signals and/ormicrocode entry points. In response to these control signals and/ormicrocode entry points, the execution unit 152 performs the appropriateoperations. The decode unit 150 may be implemented using any number ofdifferent mechanisms (e.g., a look-up table, a hardware implementation,a programmable logic array “PLA”). Any mechanism for logicallyperforming decoding of the various instructions is considered to bewithin the scope of the implementation of the invention.

The decode unit 150 is shown including a packed data instruction set 160for performing operations on packed data. In one possible embodiment,the packed data instruction set 160 includes the shuffle instruction(s)164 for performing in-lane vector shuffle operations. The number formatfor the instructions can be any format including signed and unsignedintegers, floating-point numbers, and non-numeric data. The operationsof these shuffle instructions are briefly described below and in greaterdetail with regard to FIGS. 2a-2c, 3a-3b, 5a-5c and 6a -6 b.

One embodiment includes shuffling packed data elements according to asingle shuffle instruction 164 that specifies a field of per-lanecontrol bits, a single source operand and a destination operand. Thesource and destination operands each have corresponding multi-bit lanesthat may be divided into upper and lower portions, each including asimilar number of data elements. According to the field of per-lanecontrol bits, a substantially similar set of data elements can beselected from any data elements in corresponding portions of everymulti-bit lane of the source operand. Then each data element of theselected set can be copied, according to the field of per-lane controlbits, to any specified data fields located in corresponding portions ofevery multi-bit lane of the destination operand.

Alternatively, a single shuffle instruction 164 specifies the field ofper-lane control bits, a first source operand, a second source operand,and a destination operand, all operands having corresponding multi-bitlanes, the corresponding multi-bit lanes having corresponding portions,each including a substantially similar number of data elements. Again,using a field of per-lane control bits, a set of data elements can beselected including data elements from every multi-bit lane portion ofthe first source operand and including data elements from everycorresponding multi-bit lane portion of the second source operand. Eachdata element of the selected set can then be copied to specifiedlocations in corresponding multi-bit lanes of the destination operand.

In addition to the packed data instructions, processor 105 can includenew instructions and/or instructions similar to or the same as thosefound in existing general purpose processors. For example, in oneembodiment, the processor 105 supports an instruction set which iscompatible with the Intel® Architecture instruction set used in thePentium® processors and/or Core™ processors.

It will be appreciated that as in some instructions of the Intel®Architecture instruction set and in some embodiments of shuffleinstruction 164, a source operand and a destination operand as describedherein may, in fact, be the same operand and source data may beoverwritten by destination data in that operand. Alternative embodimentsof the invention may contain more or less, as well as different, packeddata instructions and still utilize the teachings of the invention.

The registers 151 represent a storage area on processor 105 for storinginformation, including control/status information, integer data,floating point data, and packed data. It will be understood by one ofordinary skill in the art that one aspect of the invention is thedescribed instruction set for operating on packed data as well as howthe instructions are used. According to these aspects of the invention,the storage area used for storing the packed data is not critical. Theterm data processing system is used herein to refer to any machine forprocessing data, including the computer systems(s) described withreference to FIG. 1.

While one embodiment of the invention is described below with regard toFIGS. 5b-5c , in which the processor 105, executing the packed datainstructions operates on 256-bit packed data operands containing sixteen16-bit packed data elements called “words,” the processor 105 canoperate on packed data in several different packed data formats. Forexample, in one embodiment, packed data can be operated on a “byte”format or a “double word” (dword) format. The packed byte formatincludes thirty-two separate 8-bit data elements and the packed dwordformat includes eight separate 32-bit data elements, for example asshown in FIG. 5a . While certain instructions are discussed below withreference to integer data, the instructions may be applied to otherpacked data formats as well. The 32-bit data elements shown in FIG. 5aor as shown in FIG. 6b may represent packed single-precisionfloating-point data, for example, and 64-bit data elements shown in FIG.6a may be understood to represent packed double-precision floating-pointdata.

FIG. 2a illustrates a flow diagram for one embodiment of a process toperform a shuffle instruction 164 according to one embodiment of theinvention. Process 201 and other processes herein disclosed areperformed by processing blocks that may comprise dedicated hardware orsoftware or firmware operation codes executable by general purposemachines or by special purpose machines or by a combination of both.

This embodiment includes shuffling packed data elements according to asingle shuffle instruction 164 that specifies a field of per-lanecontrol bits 7-0, a single source operand and a destination operand. Thesource operand is accessed in processing block 220. The source anddestination operands each have corresponding multi-bit lanes. For oneembodiment these multi-bit lanes are each 128-bit lanes each including asimilar number of (e.g. in this case four) data elements. According tothe field of per-lane control bits 7-0 and the VSHUFD shuffleinstruction 164 of processing block 225, a substantially similar set ofdata elements is selected from any data elements D-A and from any dataelements H-E in each 128-bit lane of the source operand. Then inprocessing block 229 each data element of the selected set is copied,according to the field of per-lane control bits 7-0, to any data fieldslocated in corresponding portions of each 128-bit lane of thedestination operand as specified according to the VSHUFD shuffleinstruction 164.

FIG. 2b illustrates a flow diagram for one embodiment of a process 202to perform a shuffle instruction 164 according to an alternativeembodiment of the invention. This embodiment includes shuffling packeddata elements according to a single shuffle instruction 164 that againspecifies a field of per-lane control bits 7-0, a single source operandand a destination operand. The source operand is accessed in processingblock 240. The source and destination operands each have correspondingmulti-bit lanes. For example, in this case these multi-bit lanes areeach 128-bit lanes that may be divided into upper and lower portions,each including a similar number of (e.g. in this case four) dataelements. According to the field of per-lane control bits 7-0 and theVSHUFLW shuffle instruction 164 of processing block 245, a substantiallysimilar set of data elements is selected from any data elements D-A andfrom any data elements H-E in corresponding lower portions of each128-bit lane of the source operand. Then in processing block 249 eachdata element of the selected set is copied, according to the field ofper-lane control bits 7-0, to any data fields located in correspondingportions of each 128-bit lane of the destination operand as specifiedaccording to the VSHUFLW shuffle instruction 164. The higher portions ofeach 128-bit lane of the source operand (in this case bits 255-192 andbits 127-64) are copied to corresponding higher portions of each 128-bitlane of the destination operand.

FIG. 2c illustrates a flow diagram for one embodiment of a process 203to perform a shuffle instruction 164 according to another alternativeembodiment of the invention. This embodiment includes shuffling packeddata elements according to a single shuffle instruction 164 that alsospecifies a field of per-lane control bits 7-0, a single source operandand a destination operand. The source operand is accessed in processingblock 250. Again the source and destination operands each havecorresponding multi-bit lanes, which are both 128-bit lanes in thiscase, that may be divided into upper and lower portions, each includinga similar number (e.g. four) of data elements. According to the field ofper-lane control bits 7-0 and the VSHUFHW shuffle instruction 164 ofprocessing block 255, a substantially similar set of data elements isselected from any data elements D-A and from any data elements H-E incorresponding higher portions of each 128-bit lane of the sourceoperand. Then in processing block 259 each data element of the selectedset is copied, according to the field of per-lane control bits 7-0, toany data fields located in corresponding portions of each 128-bit laneof the destination operand as specified according to the VSHUFHW shuffleinstruction 164. The lower portions of each 128-bit lane of the sourceoperand (in this case bits 191-128 and bits 63-0) are copied tocorresponding lower portions of each 128-bit lane of the destinationoperand.

FIG. 3a illustrates a flow diagram for one embodiment of a process 301to perform a shuffle instruction 164 according to another alternativeembodiment of the invention. This embodiment includes shuffling packeddata elements according to a single shuffle instruction 164 thatspecifies a field of per-lane control bits 3-2 and bits 1-0, a firstsource operand, a second source operand, and a destination operand. Thefirst source operand, S1, is accessed in processing block 380A. Thesecond source operand, S2, is accessed in processing block 380B. Alloperands have corresponding multi-bit lanes, which are 128-bit lanes inthis case, each multi-bit lane includes a substantially similar number(e.g. two) of data elements. According to the field of per-lane controlbits 3-2, bits 1-0 and the VSHUFPD shuffle instruction 164 of processingblock 385, a set of data elements can be selected including dataelements (X1 or X2 and X3 or X4) from the 128-bit lanes of the firstsource operand and data elements (Y1 or Y2 and Y3 or Y4) from the128-bit lanes of the second source operand. Then in processing block 389each data element of the selected set is copied to locations incorresponding 128-bit lanes of the destination operand as specifiedaccording to the VSHUFPD shuffle instruction 164.

FIG. 3b illustrates a flow diagram for one embodiment of a process 302to perform a shuffle instruction 164 according to another alternativeembodiment of the invention. This embodiment includes shuffling packeddata elements according to a single shuffle instruction 164 thatspecifies a field of per-lane control bits 7-0, a first source operand,a second source operand, and a destination operand. The first sourceoperand, S1, is accessed in processing block 390A. The second sourceoperand, S2, is accessed in processing block 390B. All operands havecorresponding multi-bit lanes, which are 128-bit lanes in this case,each multi-bit lane includes a substantially similar number (e.g. four)of data elements. According to the single field of per-lane control bits7-0 and the VSHUFPS shuffle instruction 164 of processing block 395, aset of data elements can be selected including corresponding dataelements (X1-X4 or X5-X8) from every 128-bit lane of the first sourceoperand and including corresponding data elements (Y1-Y4 or Y5-Y8) fromevery 128-bit lane of the second source operand. Then in processingblock 399 each data element of the selected set is copied to locationsin corresponding 128-bit lanes of the destination operand as specifiedaccording to the VSHUFPS shuffle instruction 164.

FIG. 4 illustrates an example of a control word, imm8, 401 to specify afield of per-lane control bits up to bits 7-0. As described above,embodiments of shuffle instruction 164 may specify a field of per-lanecontrol bits, one or more source operands, and a destination operand,wherein the field of per-lane control bits is specified by a portion ofan 8-bit immediate operand, imm8. It will be appreciated that byspecifying the field of per-lane control bits as described a longercontrol word is not needed to handle operands where more data fields arepermitted. Therefore decoding hardware may be less complex and hencefaster, and the sizes of execution units may be more proportional to thenumber of data fields that are permitted rather than to the square ofthat number.

FIG. 5a illustrates the operation 501 of the shuffle instruction 164 inaccordance with an embodiment of the invention. This embodiment includesshuffling packed data elements in an execution unit 152 responsive tothe decoding, in decode unit 150, of a single shuffle instruction 164that specifies a field of per-lane control bits 7-0, a single sourceoperand 520 and a destination operand 529. Source operand 520 anddestination operand 529 each have corresponding multi-bit lanes. For oneembodiment the multi-bit lanes are all 128-bit lanes each including asimilar number of (e.g. in this case four) data elements.

Responsive to the decoding of the VSHUFD shuffle instruction 164 asubstantially similar set of data elements is selected from any dataelements D-A by the 4:1 multiplexers 524-521 and from any data elementsH-E by the 4:1 multiplexers 528-525 in each 128-bit lane of sourceoperand 520 according to the field of per-lane control bits 7-0. Usingthe outputs of the 4:1 multiplexers 524-521 and the 4:1 multiplexers528-525, data elements of the selected set are copied to any of the datafields located in corresponding 128-bit lanes of the destination operand529 as specified according to the VSHUFD shuffle instruction 164 and thefield of per-lane control bits 7-0.

FIG. 5b illustrates the operation 502 of the shuffle instruction 164 inaccordance with an alternative embodiment of the invention. Thisembodiment includes shuffling packed data elements in an execution unit152 responsive to the decoding, in decode unit 150, of a single shuffleinstruction 164 that again specifies a field of per-lane control bits7-0, a single source operand 540 and a destination operand 549. Thesource operand 540 and destination operand 549 each have correspondingmulti-bit lanes. For example, in this case these multi-bit lanes areeach 128-bit lanes that may be further divided into upper portions (e.g.bits 255-192 and 127-64) and lower portions (e.g. bits 191-128 and63-0), each including a similar number of (e.g. in this case four) dataelements.

Responsive to the decoding of the VSHUFLW shuffle instruction 164 asubstantially similar set of data elements is selected from any dataelements D-A by the 4:1 multiplexers 544-541 and from any data elementsH-E by the 4:1 multiplexers 548-545 in corresponding lower portions ofeach 128-bit lane of source operand 540 according to the field ofper-lane control bits 7-0. Using the outputs of the 4:1 multiplexers544-541 and the 4:1 multiplexers 548-545, data elements of the selectedset are copied to any of the data fields located in corresponding lowerportions of each 128-bit lane of the destination operand 549 asspecified according to the VSHUFLW shuffle instruction 164 and the fieldof per-lane control bits 7-0. The higher portions of each 128-bit laneof source operand 540 (e.g. bits 255-192 and 127-64) are copied tocorresponding higher portions of each 128-bit lane of destinationoperand 549.

FIG. 5c illustrates the operation 503 of the shuffle instruction 164 inaccordance with another alternative embodiment of the invention. Thisembodiment includes shuffling packed data elements in an execution unit152 responsive to the decoding, in decode unit 150, of a single shuffleinstruction 164 that also specifies a field of per-lane control bits7-0, a single source operand 550 and a destination operand 559. Thesource operand 550 and destination operand 559 each have correspondingmulti-bit lanes. For example, in this case these multi-bit lanes areeach 128-bit lanes that may be further divided into upper portions (e.g.bits 255-192 and 127-64) and lower portions (e.g. bits 191-128 and63-0), each including a similar number of (e.g. four) data elements.

Responsive to the decoding of the VSHUFHW shuffle instruction 164 asubstantially similar set of data elements is selected from any dataelements D-A by the 4:1 multiplexers 554-551 and from any data elementsH-E by the 4:1 multiplexers 558-555 in corresponding higher portions ofeach 128-bit lane of source operand 550 according to the field ofper-lane control bits 7-0. Using the outputs of the 4:1 multiplexers554-551 and the 4:1 multiplexers 558-555, data elements of the selectedset are copied to any of the data fields located in corresponding higherportions of each 128-bit lane of the destination operand 559 asspecified according to the VSHUFHW shuffle instruction 164 and the fieldof per-lane control bits 7-0. The lower portions of each 128-bit lane ofsource operand 550 (e.g. bits 191-128 and 63-0) are copied tocorresponding lower portions of each 128-bit lane of destination operand559.

FIG. 6a illustrates the operation 601 of the shuffle instruction 164 inaccordance with another alternative embodiment of the invention. Thisembodiment includes shuffling packed data elements in an execution unit152 responsive to the decoding, in decode unit 150, of a single shuffleinstruction 164 that specifies a field of per-lane control bits 3-2 andbits 1-0, a first source operand 680A, a second source operand 680B, anda destination operand 689. First source operand 680A, second sourceoperand 680B, and destination operand 689 all have correspondingmulti-bit lanes, which are 128-bit lanes in this case, each multi-bitlane includes a substantially similar number (e.g. two) of dataelements.

Responsive to the decoding of the VSHUFPD shuffle instruction 164 a setof data elements can be selected including corresponding data elements(X1 or X2 and X3 or X4) from every 128-bit lane of first source operand680A by the 2:1 multiplexers 683 and 681 and including correspondingdata elements (Y1 or Y2 and Y3 or Y4) from every 128-bit lane of secondsource operand 680B by the 2:1 multiplexers 684 and 682 according to thefield of per-lane control bits 3-2 and bits 1-0. Using the outputs ofthe 2:1 multiplexers 684-681 data elements of the selected set arecopied to locations in corresponding 128-bit lanes of the destinationoperand 689 as specified according to the VSHUFPD shuffle instruction164 and the field of per-lane control bits 3-2 and bits 1-0.

FIG. 6b illustrates the operation 602 of the shuffle instruction 164 inaccordance with another alternative embodiment of the invention. Thisembodiment includes shuffling packed data elements in an execution unit152 responsive to the decoding, in decode unit 150, of a single shuffleinstruction 164 that specifies a single field of per-lane control bits7-0, a first source operand 690A, a second source operand 690B, and adestination operand 699. First source operand 690A, second sourceoperand 690B, and destination operand 699 all have correspondingmulti-bit lanes, which are 128-bit lanes in this case, each multi-bitlane includes a substantially similar number (e.g. four) of dataelements.

Responsive to the decoding of the VSHUFPS shuffle instruction 164 a setof data elements can be selected including corresponding data elements(X1-X4 or X5-X8) from every 128-bit lane of first source operand 690A bythe 4:1 multiplexers 691-692 and 695-696 and including correspondingdata elements (Y1-Y4 or Y5-Y8) from every 128-bit lane of second sourceoperand 690B by the 4:1 multiplexers 693-694 and 697-698 according tothe field of per-lane control bits 7-0. Using the outputs of the 4:1multiplexers 698-691 data elements of the selected set are copied tolocations in corresponding 128-bit lanes of the destination operand 689as specified according to the VSHUFPS shuffle instruction 164 and thefield of per-lane control bits 7-0.

The above description is intended to illustrate preferred embodiments ofthe present invention. From the discussion above it should also beapparent that especially in such an area of technology, where growth isfast and further advancements are not easily foreseen, the invention maybe modified in arrangement and detail by those skilled in the artwithout departing from the principles of the present invention withinthe scope of the accompanying claims and their equivalents.

What is claimed is:
 1. A processor comprising: a plurality of registers;a decode unit to decode a single instruction indicating a sourceoperand, a destination operand, and an immediate operand, wherein thesource operand and the destination operand each have a first lane and asecond lane, wherein a lower portion of the first lane of the sourceoperand is to store data elements D, C, B, and A (D-A), wherein a lowerportion of the second lane of the source operand is to store dataelements H, G, F, and E (H-E), and wherein the immediate operand is tohave a first plurality of control bits, a second plurality of controlbits, a third plurality of control bits, and a fourth plurality ofcontrol bits; and an execution unit coupled with the decode unit andcoupled with the plurality of registers, the execution unit to executethe single instruction to generate and store a result of the singleinstruction in the destination operand, wherein the result stored in thedestination operand includes one of the data elements D-A specified bythe first plurality of control bits in a first data element position ofa lower portion of the first lane of the destination operand, one of thedata elements D-A specified by the second plurality of control bits in asecond data element position of a lower portion of the first lane of thedestination operand, one of the data elements D-A specified by the thirdplurality of control bits in a third data element position of a lowerportion of the first lane of the destination operand, and one of thedata elements D-A specified by the fourth plurality of control bits in afourth data element position of a lower portion of the first lane of thedestination operand, and wherein the result stored in the destinationoperand includes one of the data elements H-E specified by the firstplurality of control bits in a first data element position of a lowerportion of the second lane of the destination operand, one of the dataelements H-E specified by the second plurality of control bits in asecond data element position of a lower portion of the second lane ofthe destination operand, one of the data elements H-E specified by thethird plurality of control bits in a third data element position of alower portion of the second lane of the destination operand, one of thedata elements H-E specified by the fourth plurality of control bits in afourth data element position of a lower portion of the second lane ofthe destination operand.